<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>

<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>我的订单</title>
	<%@include file="/pages/common/head_info.jsp"%>
	<link type="text/css" rel="stylesheet" href="static/css/index.css" >
	<link type="text/css" rel="stylesheet" href="static/css/head.css" >

<style type="text/css">
	h1 {
		text-align: center;
		margin-top: 200px;
	}
</style>
</head>
<body>

<div class="head">
	<div class="logo">
		<h1 style="margin-top:0;"><a href="pages/client/index.jsp">线上社区超市</a></h1>
	</div>

	<div>
		<c:if test="${empty sessionScope.userId}">
			<div class="userdata" style="width: 300px;margin-right: 250px;">
				<a href="pages/user/regist.jsp"><h3>注册</h3></a>
				<a href="pages/user/login.jsp"><h3>登录</h3></a>
			</div>
		</c:if>
		<c:if test="${not empty sessionScope.userId}">
			<div class="userdata" style="width: 400px;margin-right: 150px;">
				<a href="userServlet?action=logout"><h3 style="font-size: 10px;">注销</h3></a>
				<a href="orderServlet?action=showMyOrder"><h3 style="font-size: 10px;">我的订单</h3></a>
				<a href="pages/user/userdata.jsp"><h3 style="font-size: 10px;">个人信息</h3></a>
			</div>
		</c:if>
	</div>

</div>
	
	<div class="main">
		
		<table style="margin-top:0">

			<tr>
				<td>日期</td>
				<td>金额</td>
				<td>状态</td>
				<td>详情</td>
			</tr>
			<c:forEach items="${sessionScope.order}" var="form">
				<tr>
					<td>${form.createTime}</td>
					<td>${form.price}</td>
					<c:if test="${form.status.equals('NOT_SHIPPED')}">
						<td>未发货</td>
					</c:if>
					<c:if test="${form.status.equals('SHIPPED')}">
						<td>已发货</td>
					</c:if>
					<c:if test="${form.status.equals('RECEIVED')}">
						<td>已完成</td>
					</c:if>
					<td><a href="orderServlet?action=showOrderDetail&orderCode=${form.orderCode}" style="text-decoration: none;">查看详情</a></td>
				</tr>
			</c:forEach>

		</table>
		
	
	</div>
</body>
</html>